#include "board.hpp"
#include <algorithm>

Board::Board() {std::fill(board, board+200, 0);}
void Board::set(int y, int x, char z)
{
	if(y*10+x < 0 || y*10+x > 199)
		return;
	board[y*10+x] = z;
}
char Board::get(int y, int x)
{
	if(y*10+x < 0 || y*10+x > 199)
		return 0;
	return board[y*10+x];
}

bool Board::test(int y)
{
	for(int x = 0;x < 10;x++)
		if(get(y,x) == 0)
			return false;
	return true;
}

void Board::clean(int y)
{
	for(int i = y;i >= 0;i--)
	{
		for(int x = 0;x < 10;x++)
			set(i,x,get(i-1,x));
	}
}
